<?php 
namespace app\common\model;
class News extends Common{
	protected $insert = ['addtime'=>SYS_TIME];
	protected function getAddtimeAttr($value){
		
		return date("Y-m-d H:i", $value);
	}
	protected function getStatusnameAttr($value,$data){
		
		return $data['status'] ? "开启" : "关闭";
	}
	// protected function getThumbAttr($value){

	// 	return APP_URL."/".$value;
	// }
	public function list_datas($where){
		$data = $this->where($where)->field(['id','title','thumb'])->select();
		$data1 = [];
		foreach ($data as $v){
			$v['linkurl'] = APP_URL."/index/news/news_detail/id/".$v['id'];	
			$data1[] = $v;
		}
		return $data1;
	}
}